<?php
use models\dao\NivelDAO;
class Nivel extends CI_Controller {

	private $nivelDAO;

	public function __construct() {
		parent::__construct();
		$this->nivelDAO = new NivelDAO($this->doctrine->em);
	}

	public function findAll() {
		$all = $this->nivelDAO->findAll();

		$result['result'] = array();

		foreach($all as $nivel) {
			array_push($result['result'], $nivel->toArray());
		}

		echo json_encode($result);
	}

}